package com.yjm.test.Spring5.ch5.aop;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import com.yjm.test.Spring5.ch5.Guitar;

@Component
public class Documentarist {
	private GrammyGuitarist guitarist;
	
	public void execute() {
		guitarist.sing();
		Guitar guitar = new Guitar();
		guitar.setBrand("Gibson");
		guitarist.sing(guitar);
		guitarist.talk();
	}
	
	public void setDep(GrammyGuitarist guitarist) {
		this.guitarist = guitarist;
	}

	public GrammyGuitarist getGuitarist() {
		return guitarist;
	}

	@Autowired
	@Qualifier("JohnMayer")
	public void setGuitarist(GrammyGuitarist guitarist) {
		this.guitarist = guitarist;
	}
}
